Quiz 8

Question # 1

Q

What is b in the following MySQL statement?

CREATE VIEW a (b) AS SELECT c FROM d;
A)

Row name

B)

Column name

C)

View name

D)

Database name

Question # 2

Q

Consider the following table with one column having integer data type as follows:

CREATE TABLE xyz(num INT);

Two views A and B are created based on this table as follows:

CREATE VIEW A AS    SELECT num    FROM xyz    WHERE num > 10;CREATE VIEW B AS    SELECT num     FROM A     WHERE num<20    WITH CHECK OPTION;

What will happen when the following query is executed?

INSERT INTO B (num) VALUES (5);
A)

INSERT is successful because the value conforms with the definition of view B (num < 20)

B)

INSERT results in a CHECK OPTION failed error because the value 5 does not meet the condition num > 10 of view A

Question # 3

Q

Which of the following statements are true about the WITH CHECK OPTION clause?

A)

The WITH CHECK OPTION clause can be given for an updatable or non-updatable view

B)

The WITH CHECK OPTION clause prevents inserts of rows for which the WHERE clause in the select_statement is not true.

C)

The WITH CHECK OPTION clause prevents updates to rows for which the WHERE clause is true but the update would cause it to be not true

D)

Whenever DDL statements are issued against a view having WITH CHECK OPTION, MySQL checks to ensure that the rows being changed are conformable to the definition of the view.

Question # 4

Q

There is an optional ALGORITHM clause in CREATE VIEW and ALTER VIEW statements. It determines how MySQL processes a view. The ALGORITHM clause can take one of three values MERGE, TEMPTABLE, and UNDEFINE. Consider the following query:

CREATE ALGORITHM=MERGE VIEW ActorView(       Id, firstName, lastName, birthday) AS    SELECT        ActorId, FirstName, LastName, Dob    FROM Actors;

How will MySQL process the following query?

SELECT * FROM ActorViewWHERE lastname < 'J';
A)

MySQL will combine the input query with the SELECT statement of the view definition into a single query and execute the query to get the result.

B)

MySQL will create a temporary table to store the results of the SELECT query of the view definition and execute the query against the temporary table.

Question # 5

Q

Which statement is true about tables and views?

A)

A table is a logical object and a view is a physical object.

B)

A table is an independent object and a view is a dependent object.

C)

If a table is created from an existing table, changes in the old table will be reflected in the new table.

D)

If a view is created from an existing table, changes in the table will not be reflected in the view.

Quiz 7
Quiz 9
Mark as Completed
Report an Issue